package com.rookie.shiro.module.constant;

/**
 * @author rookie
 */

public enum TokenTypeEnum {

    /**
     * token类型
     */
    PC("pc"),

    ADMIN("admin"),

    APP("app"),

    WE_CHAT("weChat"),

    /**
     * 移动端
     */
    MOBILE("mobile");

    /**
     * 描述
     */
    private String message;


    TokenTypeEnum(String message) {
        this.message = message;
    }

    public String getMessage() {
        return message;
    }

    public static TokenTypeEnum getCode(String code) {
        for (TokenTypeEnum tokenTypeEnum : TokenTypeEnum.values()) {
            if (tokenTypeEnum.getMessage().equals(code)) {
                return tokenTypeEnum;
            }
        }
        return null;
    }
}
